home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freaks Macintosh Archive
/
Freaks Macintosh Archive.bin
/
Freaks Macintosh Archives
/
Aol
/
aol-unsorted
/
AOLHeaderStrip.pl.sit
/
AOLHeaderStrip.pl.rsrc
/
TEXT_128_!.txt
< prev
next >
Wrap
Text File
|
1997-11-29
|
2KB
|
36 lines
# This script reads in an AOL text mail file and strips of the "headers"
# at the end of the file which tend to confuse some file viewers.
# Written by William Cameron, 29 Nov 1997.
# Requires MacPerl by Matthias Neeracher and Tim Endres
# This is what precedes the headers in AOL mail files.
$header = "----------------------- Headers --------------------------------\n";
$index = 0; # this variable used to address each filename in @ARGV
# For each of the files dropped on this droplet do the following:
# read in a line
# check to see if it is the AOL Header line
# if not, write the line to a file of the same name on the desktop
# if it does match, close the input and output files, and get the next file
while ($ARGV[$index]){
$infile = $ARGV[$index];
@path = split(/:/, $infile);
open (IN, "$infile");
# THE NEXT THREE LINES ARE NO LONGER APPLIED--not general enough
# Match up to the last 31 characters following a colon--this is the file name.
# Replace the path with the destination path as coded.
# $outfile =~ s/.+:([ -9;-~]{1,31})$/Kermie 234:Desktop Folder:$1/;
#
# Instead, we do it this way.
# $path[0] is the name of the drive the files were on
# $#path is the index of the last element of the array @path,
# so $path[$#path] is the name of the file.
$outfile = $path[0] . ':' . 'Desktop Folder' . ':' . $path[$#path];
open(OUT, ">>$outfile");
MacPerl::SetFileInfo('R*ch', 'TEXT', $outfile);
while ($line = <IN>) {
last if ($line eq $header);
print OUT $line;
}
close (IN);
close (OUT);
$index++;
}